import {
    GraphQLSchema,
    GraphQLObjectType
} from 'graphql';
// 引入 type
import {
    companyList,
    companyOne,
    companyUpdate,
    companyAdd,
    companyDel

} from './models/company'


import {
    departmentList,
    departmentOne,
    departmentAdd,
    departmentDel,
    departmentUpdate
} from './models/department'


import {
    deviceGroupByDepartments,
    deviceList,
    deviceListBy_Company_Department,
    deviceListBy_Company_Department_ByPage,
    deviceListBy_User,
    deviceList_Type_Count_By_Company_Department,
    deviceListSearch,
    deviceUpdatePeizhi,
    deviceUpdateBaoxiu,
    deviceOne,
    deviceAdd,
    deviceDel,
    deviceUpdate
} from './models/device'

import {
    jurisdictionList,
    jurisdictionOne,
    jurisdictionListByType,
    getUserJurisdiction,
    jurisdictionAdd,
    jurisdictionUpdate,
    jurisdictionDel
} from './models/Jurisdiction'

import {
    kindList,
    kindOne,
    kindAdd,
    kindUpdate,
    kindDel
} from './models/kind'

import {
    roleList,
    roleOne,
    roleAdd,
    roleUpdate,
    roleDel,
    roleFind,
    role_jurisdiction_ChangeOne,
    role_jurisdiction_ChangeTow,
    role_user_ChangeOne,
    role_user_ChangeTow
} from './models/role'

import {
    service_providerList,
    service_providerOne,
    service_providerAdd,
    service_providerDel,
    service_providerUpdate
} from './models/service_provider'

import {
    userList,
    userOne,
    userListSearch,
    userLogin,
    userAdd,
    userDel,
    userUpdate
} from './models/user'

import {
    Role_jurisdiction_By_Role,
    Role_jurisdiction_By_jurisdiction
} from './models/role_jurisfiction'

import {
    Role_User_By_Role,
    Role_User_By_User
} from './models/role_user'


import {
    info,
    qudong
} from './models/lenovo'



// 建立 schema
export default new GraphQLSchema({
    query: new GraphQLObjectType({
        name: 'Queries',
        fields: {
            companyList,
            companyOne,
            departmentList,
            departmentOne,
            deviceList,
            deviceListBy_Company_Department,
            deviceListBy_Company_Department_ByPage,
            deviceListBy_User,
            deviceList_Type_Count_By_Company_Department,
            deviceListSearch,
            deviceOne,
            deviceGroupByDepartments,
            jurisdictionList,
            jurisdictionOne,
            jurisdictionListByType,
            getUserJurisdiction,
            kindList,
            kindOne,
            roleList,
            roleOne,
            roleFind,
            service_providerList,
            service_providerOne,
            userList,
            userListSearch,
            userOne,
            userLogin,
            Role_jurisdiction_By_Role,
            Role_jurisdiction_By_jurisdiction,
            Role_User_By_Role,
            Role_User_By_User,
            info,
            qudong
        }
    }),
    mutation: new GraphQLObjectType({
        name: 'mutation',
        fields: {
            companyUpdate,
            companyAdd,
            companyDel,
            departmentAdd,
            departmentDel,
            departmentUpdate,
            deviceAdd,
            deviceDel,
            deviceUpdate,
            deviceUpdatePeizhi,
            deviceUpdateBaoxiu,
            jurisdictionAdd,
            jurisdictionUpdate,
            jurisdictionDel,
            kindAdd,
            kindUpdate,
            kindDel,
            roleAdd,
            roleUpdate,
            roleDel,
            role_jurisdiction_ChangeOne,
            role_jurisdiction_ChangeTow,
            role_user_ChangeOne,
            role_user_ChangeTow,
            service_providerAdd,
            service_providerDel,
            service_providerUpdate,
            userAdd,
            userDel,
            userUpdate
        }
    })
})
